<?PHP  
   include ("../../Connections/cpsms.php");
   if (!empty($_POST['username'])) {
	 $username =$_POST['username'];
   }else{
      echo "<script language='javascript'>"; 
      echo " location='../../view/SuperUser/superUserLogin.php?id=1';"; 
      echo "</script>";
   }
   if (!empty($_POST['password'])) {
   $password = $_POST['password'];
   }else{
            echo "<script language='javascript'>"; 
      echo " location='../../view/SuperUser/superUserLogin.php?id=2';"; 
      echo "</script>";
   }
   
  $query = "select * from superusers where sloginname='$username' and sloginpassword='$password';";
	$sql = mysql_query($query) or die(mysql_error());
	$count = mysql_num_rows($sql);
	  
if($count == 1){
session_start(); 
$_SESSION['supername'] = $username; // store session data
echo "Pageviews = ". $_SESSION['supername']; //retrieve data
      echo "<script language='javascript'>"; 
      echo " location='../../view/SuperUser/RetrivalUser.php';"; 
      echo "</script>";
    exit;
      }else{
	  echo ("sorry your username and password are not creact. Please try again.");
      echo "<script language='javascript'>"; 
      echo " location='../../view/SuperUser/superUserLogin.php?id=3';"; 
      echo "</script>";
	  }
   

?>